<!DOCTYPE html>
<html lang="{{ config('app.locale') }}">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title> 888</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">

    {!! Admin::css() !!}

    <script src="{{ Admin::jQuery() }}"></script>
    {!! Admin::headerJs() !!}
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body >







        <div id="app">
            <section class="content-header">
                <h1>
                    <small>品牌添加</small>
                </h1>

            </section>

            <section class="content">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-info">
                            <div class="box-header with-border">


                                <div class="box-tools">
                                    <div class="btn-group pull-right" style="margin-right: 5px">
                                        <a href="/admin/brand/index" class="btn btn-sm btn-default" title="品牌列表"><i class="fa fa-list"></i><span class="hidden-xs">&nbsp;品牌列表</span></a>
                                    </div>
                                </div>
                                <span>
    <a class="btn btn-sm btn-primary grid-refresh" title="刷新"><i class="fa fa-refresh"></i><span class="hidden-xs"> 刷新</span></a>
    <a class="btn btn-sm btn-primary" onclick="javascript:history.go(-1);" title="返回"> <span class="hidden-xs"> 返回</span></a>
  </span>
                            </div>
                            <!-- /.box-header -->
                            <!-- form start -->
                            <form id="addForm" action="/admin/goods/goodsAdd" method="post" accept-charset="UTF-8" class="form-horizontal" enctype="multipart/form-data" pjax-container>
                                <div class="box-body">
                                    <div class="fields-group">

                                        <div class="form-group  ">
                                            <label for="cate_name" class="col-sm-2  control-label">品牌名称</label>
                                            <div class="col-sm-8">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><i class="fa fa-pencil fa-fw"></i></span>
                                                    <input type="text" id="brand_name" name="brand_name" value="" class="form-control brand_name" placeholder="输入 品牌名称" />
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="brand_note" class="col-sm-2  control-label">品牌注释</label>
                                            <div class="col-sm-8">
                                                <div class="input-group">
                                                    <span class="input-group-addon"><i class="fa fa-pencil fa-fw"></i></span>
                                                    <input style="width:30%" type="text" id="brand_note" name="brand_note" value="" class="form-control brand_note" placeholder="输入 品牌简单阐释" />
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group  ">
                                            <label for="is_official_auth" class="col-sm-2  control-label">是否官方授权</label>
                                            <div class="col-sm-8">
                                                <label class="radio-inline">
                                                    <input type="radio" name="is_official_auth" value="1" class="minimal is_official_auth" checked  />&nbsp;否&nbsp;&nbsp;
                                                </label>
                                                <label class="radio-inline">
                                                    <input type="radio" name="is_official_auth" value="2" class="minimal is_official_auth"   />&nbsp;是&nbsp;&nbsp;
                                                </label>
                                            </div>
                                        </div>

                                        {{--<div class="form-group  ">--}}
                                        {{--<label for="brand_is_del" class="col-sm-2  control-label">是否删除</label>--}}
                                        {{--<div class="col-sm-8">--}}
                                        {{--<label class="radio-inline">--}}
                                        {{--<input type="radio" name="brand_is_del" value="1" class="minimal brand_is_del" checked  />&nbsp;否&nbsp;&nbsp;--}}
                                        {{--</label>--}}
                                        {{--<label class="radio-inline">--}}
                                        {{--<input type="radio" name="brand_is_del" value="2" class="minimal brand_is_del"   />&nbsp;是&nbsp;&nbsp;--}}
                                        {{--</label>--}}
                                        {{--</div>--}}
                                        {{--</div>--}}

                                        <div class="form-group  ">
                                            <label for="img" class="col-sm-2  control-label">品牌logo</label>
                                            <div class="col-sm-8">
                                                <input type="file" class="img" name="img"  />
                                            </div>
                                        </div>

                                    </div>
                                </div>
                                <!-- /.box-body -->

                                <div class="box-footer">
                                    @csrf
                                    <div class="col-md-2">
                                    </div>
                                    <div class="col-md-8">
                                        <div class="btn-group pull-right">
                                            <button type="button" onclick="tijiao()" class="btn btn-primary">提交</button>
                                        </div>

                                        <div class="btn-group pull-left">
                                            <button type="reset" class="btn btn-warning">重置</button>
                                        </div>
                                    </div>
                                </div>
                            </form>
                        </div>

                    </div></div>
            </section>
        </div>
        <script data-exec-on-popstate>
            $(function () {
                $("input.img").fileinput({"overwriteInitial":true,"initialPreviewAsData":true,"browseLabel":"\u6d4f\u89c8","showRemove":false,"showUpload":false,"dropZoneEnabled":false,"deleteExtraData":{"goods_img_list":"_file_del_","_file_del_":"","_token":"Kq6b1qbgSwE02ACOgZOsO9QeD99PSWROQgk10d1w","_method":"PUT"},"deleteUrl":"http:\/\/www.laras.com\/admin\/goods\/","allowedFileTypes":["image"]});

                //刷新
                $('.grid-refresh').on('click', function() {
                    $.pjax.reload('#pjax-container');
                    toastr.success('刷新成功 !');
                });

            });


            function tijiao(){
                var data=new FormData($("#addForm")[0]);
                $.ajax({
                    url:"/admin/brand/add",
                    type:'post',
                    data:data,
                    dataType:'json',
                    processData: false,
                    contentType: false,
                    success:function(m){
                        if(m.status==1){
                            toastr.success(m.message);
                            window.location.href='/admin/brand/index';
                        }else{
                            swal(m.message, '', 'error');
                        }
                    }
                });
            }
        </script>







<script>
    function LA() {}
    LA.token = "{{ csrf_token() }}";
</script>

<!-- REQUIRED JS SCRIPTS -->
{!! Admin::js() !!}

</body>
</html>
